/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package gui;

import java.awt.Color;
import javax.swing.JTabbedPane;


/**
*  * <b>Project ChatSystemG6 INSA 4INFOA1 - 2013/2014</b>
 * <P>
 * <i>Package gui </i> <br>
 * TabColor  colored a tab when a message is received
 * 
 * @author Christelle SIAGO HAPPI
 * 
 */
public class TabColor extends Thread {

    private JTabbedPane panelOnglet;
    private boolean isConneted;
    
    public TabColor(JTabbedPane multichatArea) {
        this.panelOnglet = multichatArea;
        isConneted=true;    
    }

    @Override
    public void run() {
      while (isConneted) {
          panelOnglet.setBackgroundAt(panelOnglet.getSelectedIndex(), Color.BLUE);
      }

    }
    public void stopActivity(){
      isConneted=false;
    }
    public void startActivity(){
      new Thread(this).start();
    }
    
}
